clear 

use "MonadicData.dta" 


******  Table 4 with Core Models *******

* Model 1 * 
logit altinit i.democracynosuff i.autocracy minorpower relcap eithernuclear jointnuclear ldistancef distancefx2 distancefx3 noncontig dependL s_wt_glo ally year altpeaceyears altpeaceyears2 altpeaceyears3, robust cluster (dyadid)

* Model 2 * 
logit altinit i.democracynosuff i.autocracy minorpower relcap eithernuclear wcivillibs1 jointnuclear ldistancef distancefx2 distancefx3 noncontig dependL s_wt_glo ally year altpeaceyears altpeaceyears2 altpeaceyears3 if waryears == 0 , robust cluster (dyadid)

* Model 3 * 
logit altinit i.democracynosuff i.autocracy minorpower relcap ldistancef distancefx2 distancefx3 noncontig  wcivillibs1 ally year altpeaceyears altpeaceyears2 altpeaceyears3 if year > 1892 & year < 1956, robust cluster (dyadid)

* Model 4 *
xtset dyadid
xtlogit altinit i.democracynosuff i.autocracy minorpower relcap eithernuclear wcivillibs1 jointnuclear    ally year altpeaceyears altpeaceyears2 altpeaceyears3 , fe

* Model 5 * 
logit altinit c.polity1##i.suffragetrunc minorpower relcap eithernuclear jointnuclear dependL s_wt_glo ldistancef distancefx2 distancefx3 noncontig   ally year  altpeaceyears altpeaceyears2 altpeaceyears3  , robust cluster (dyadid)

* Model 6 * 
logit altinit c.polity1##i.suffragetrunc minorpower relcap eithernuclear jointnuclear dependL s_wt_glo ldistancef distancefx2 distancefx3 noncontig  wcivillibs1 ally year  altpeaceyears altpeaceyears2 altpeaceyears3  , robust cluster (dyadid)

* Model 7 * 
xtset dyadid
xtlogit altinit c.polity1##i.suffragetrunc minorpower relcap eithernuclear jointnuclear ldistancef distancefx2 distancefx3  wcivillibs1 ally year  altpeaceyears altpeaceyears2 altpeaceyears3  , fe



******  Figure 2: Predicted Probabilities *****

logit altinit i.democracynosuff i.autocracy minorpower relcap ldistancef distancefx2 distancefx3 noncontig  wcivillibs1 ally year altpeaceyears altpeaceyears2 altpeaceyears3 if year > 1889 & year < 1951, robust cluster (dyadid)
margins, at (democracynosuff = 0 autocracy = 0 )  ///
		 at (democracynosuff = 1 autocracy = 0 )  post
		 nlcom (perc_inc: (_b[2._at] - _b[1._at]) / _b[1._at])
		 
logit altinit i.democracynosuff i.autocracy minorpower relcap ldistancef distancefx2 distancefx3 noncontig  wcivillibs1 ally year altpeaceyears altpeaceyears2 altpeaceyears3 if year > 1889 & year < 1951, robust cluster (dyadid)
margins, at (democracynosuff = 0 autocracy = 0 )  ///
		 at (democracynosuff = 0 autocracy = 1 )  post
		 nlcom (perc_inc: (_b[2._at] - _b[1._at]) / _b[1._at])

logit altinit i.democracynosuff i.autocracy minorpower relcap ldistancef distancefx2 distancefx3 noncontig  wcivillibs1 ally year altpeaceyears altpeaceyears2 altpeaceyears3 if year > 1889 & year < 1951, robust cluster (dyadid)
margins, at (democracynosuff = 0 autocracy = 1 )  ///
		 at (democracynosuff = 1 autocracy = 0 )  post
		 nlcom (perc_inc: (_b[2._at] - _b[1._at]) / _b[1._at])

		 
******* Figure 3: Differences in Predicted Probabilities *******

logit altinit c.polity1##i.suffragetrunc minorpower relcap eithernuclear jointnuclear dependL s_wt_glo ldistancef distancefx2 distancefx3 noncontig  wcivillibs1 ally year  altpeaceyears altpeaceyears2 altpeaceyears3  , robust cluster (dyadid)
margins, at (polity = (1(1)10) suffragetrunc == 0 minorpower == 0 eithernuclear == 0 jointnuclear == 0 noncontig == 0 ally == 0) 
margins, at (polity = (1(1)10) suffragetrunc == 1 minorpower == 0 eithernuclear == 0 jointnuclear == 0 noncontig == 0 ally == 0) 

